Package edu.claflin.finder.algo
Class ConnectedComponentsDFS
java.lang.Object
edu.claflin.finder.algo.Algorithm
edu.claflin.finder.algo.ConnectedComponentsDFS
- All Implemented Interfaces:
Processable<Graph,Graph>
Processes a
Graph searching for connected components by performing a
depth first search.-
Nested Class Summary
Nested classes/interfaces inherited from class edu.claflin.finder.algo.Algorithm
Algorithm.GraphSortOrder -
Field Summary
Fields inherited from class edu.claflin.finder.algo.Algorithm
args, PROP_PROGRESS -
Constructor Summary
ConstructorsConstructorDescriptionPublic constructor for initializing the DepthFirstTraversalSearch with default conditions. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidRecursive dfs that stores the nodes of a connected component.getConnectedComponents(Graph graph) Gets a list of this Graph's Connected Components.Processes data.toString()Methods inherited from class edu.claflin.finder.algo.Algorithm
addPropertyChangeListener, cull, getGraphSortOrder, getMinNodeCount, getPartiteNumber, getWeightName, removePropertyChangeListener, setGraphSortOrder, setMinNodeCount, setPartiteNumber, setProgress, setWeightName, zeropad
-
Constructor Details
-
ConnectedComponentsDFS
Public constructor for initializing the DepthFirstTraversalSearch with default conditions.- Parameters:
bundle- the ArgumentsBundle containing the instantiation arguments.
-
-
Method Details
-
toString
-
process
Processes data.
Finds most Subgraphs by performing a depth first search on the node tree. It is unknown if it finds all or only most of the subgraphs due to the nature of the algorithm. It is expected, however, that it would miss certain node groupings.- Parameters:
graph- theGraphobject to search through.- Returns:
- the ArrayList of Graph objects holding all found subgraphs.
-
getConnectedComponents
Gets a list of this Graph's Connected Components. Uses Depth First Search Technique.- Parameters:
graph- the Graph to get Connected Components from.- Returns:
- the list of this Graph's Connected Components
-
dfs
Recursive dfs that stores the nodes of a connected component. Copyright (c) 2003, The JUNG Authors.- Parameters:
n- the starting nodeinodes- the nodes awaiting considerationonodes- the list of nodes already visitedvisited- the visited node lookup
-